/**
 * 
 */
package com.yonder.agenda.service.generic;

import java.util.List;

/**
 * Generic service.
 * 
 * @param <T>
 *            entity type.
 * @author CosminS
 * @since Jan 29, 2014
 */
public interface EntityService<T> {

	/**
	 * Create new entity.
	 * 
	 * @param entity
	 *            The entity to create
	 * @return persisted entity
	 */
	T create(T entity);

	/**
	 * Update entity.
	 * 
	 * @param entity
	 *            The entity to update
	 * @return Updated entity
	 */
	T update(T entity);

	/**
	 * Remove entity.
	 * 
	 * @param entityId
	 *            The entity ID
	 */
	void remove(Long entityId);

	/**
	 * Find entity by ID.
	 * 
	 * @param entityId
	 *            The entity ID
	 * @return Entity from db
	 */
	T findById(Long entityId);

	/**
	 * Find all.
	 * 
	 * @return All entities
	 */
	List<T> findAll();
}